<template>
    <div>
        <Search />
        <el-card>
            <span>测评记录</span>
            <e-table :tableConfig="tableConfig" :tableData="tableData" />
        </el-card>
    </div>
</template>

<script  lang="ts">
import { ref, reactive, defineComponent, onMounted, onBeforeMount } from 'vue';
import Search from 'comps/search/index.vue';
import SvgIcon from 'svgIcon/SvgIcon.vue';
import ETable from 'comps/eTable/index.vue';
import { useRouter } from 'vue-router';
export default defineComponent({
    name: 'home',
    components: { Search, SvgIcon, ETable },
    setup() {
        const router = useRouter();
        const tableConfig = reactive(
            //表格配置
            {
                thead: [
                    { lable: '评测日期', prop: 'date', width: '139' },
                    { lable: '终端设备', prop: 'name' },
                    { lable: '设备MAC', prop: 'mac' },
                    { lable: '互联网方式', prop: 'hts' },
                    { lable: '测试地点', prop: 'address' },
                    { lable: '型号强度(dBm)', prop: 'dBm' },
                    { lable: '宽带速度', prop: 'kd' },
                    { lable: '云服务性能', prop: 'yfw' }
                ],
                operates: [
                    {
                        id: 1,
                        label: '评测详情',
                        type: 'text',
                        method: (index: any, row: any) => {
                            router.push({ name: 'reviewsDetails', params: { id:row.id } });
                            console.log(row);
                            console.log(11);
                        }
                    }
                ]
            }
        );
        const tableData = reactive([
            {
                id: '1',
                date: '2016-05-02 10:55:01',
                name: 'HONOR V30',
                mac: '50-EB-71-B1-5F-C1',
                hts: '联通5G',
                address: '广东省广州市天河区天河路518号',
                dBm: '优(-81)',
                kd: '898.78',
                yfw: '优'
            },
            {
                id: '2',
                date: '2016-05-02 10:55:01',
                name: 'HONOR V30',
                mac: '50-EB-71-B1-5F-C1',
                hts: '联通5G',
                address: '广东省广州市天河区天河路518号',
                dBm: '优(-81)',
                kd: '898.78',
                yfw: '优'
            }
        ]);

        return {
            tableConfig,
            tableData
        };
    }
});
</script>

<style lang="scss">
</style>
